#include <iostream>
#include <vector>

using namespace std;

class Solution
{
public:
    void sortColors(vector<int> &nums)
    {
        int index0 = 0;
        int index2 = nums.size() - 1;
        for (int i = 0; i <= index2; i++)
        {
            while (nums[i] == 2 && i != index2)
            {
                swap(nums[i], nums[index2]);
                index2--;
            }
            if (nums[i] == 0)
            {
                swap(nums[i], nums[index0]);
                index0++;
            }
        }
    }
};

int main()
{
    cout << "Code75" << endl;
    Solution s;
    vector<int> nums = {0};
    s.sortColors(nums);
    for (int i = 0; i < nums.size(); i++)
    {
        cout << nums[i] << " ";
    }
    return 0;
}